import Layout from "@/layout/layout.vue";
import Error from "@/views/error.vue";
import { RouteRecordRaw } from "vue-router";
import Login from "@/views/login.vue";
import Screen from "@/views/home/home.vue";
import Iframe from "@/views/iframe.vue";

/**
 * 框架基础路由
 */
const routes: Array<RouteRecordRaw> = [
  /*  {
      path: "/",
      component: Layout,
      redirect: "/home",
      meta: { title: "ui.router.pageWorkbench", icon: "icon-desktop" },
      children: [
        {
          path: "/home",
          component: () => import("@/views/home.vue"),
          meta: { title: "ui.router.pageHome", icon: "icon-home" }
        }
      ]
    },*/
  {
    path: "/",
    redirect: "/home/home"
  },
  {
    path: "/home/home",
    component: Screen,
    meta: { title: "塍里村智慧屏", isNavigationMenu: false }
  },
  {
    path: "/home/loveParty",
    component: () => import("@/views/home/loveParty.vue"),
    meta: { title: "塍心向党", isNavigationMenu: false }
  },
  {
    path: "/home/partyPolitics",
    component: () => import("@/views/home/partyPolitics.vue"),
    meta: { title: "知塍晓政", isNavigationMenu: false }
  },
  {
    path: "/home/cultureHome",
    component: () => import("@/views/home/cultureHome.vue"),
    meta: { title: "文明塍里", isNavigationMenu: false }
  },
  {
    path: "/home/livHome",
    component: () => import("@/views/home/livHome.vue"),
    meta: { title: "生活塍里", isNavigationMenu: false }
  },
  {
    path: "/home/gatherHome",
    component: () => import("@/views/home/gatherHome.vue"),
    meta: { title: "一塍千延", isNavigationMenu: false }
  },
  // {
  //   path: "/home/digitalMap",
  //   component: () => import("@/views/home/digitalMap.vue"),
  //   meta: { title: "数字地图", isNavigationMenu: false }
  // },
  {
    path: "/home/digitalMap",
    component: () => import("@/views/home/copyMap.vue"),
    meta: { title: "数字地图", isNavigationMenu: false }
  },
  {
    path: "/home/points",
    component: () => import("@/views/home/points.vue"),
    meta: { title: "数字资产", isNavigationMenu: false }
  },
  {
    path: "/home/safe",
    component: () => import("@/views/home/safe.vue"),
    meta: { title: "安全管理", isNavigationMenu: false }
  },
  {
    path: "/sys/map-plop",
    component: () => import("@/views/map/plopMap.vue"),
    meta: { title: "地图标注", isNavigationMenu: false }
  },
  {
    path: "/login",
    component: Login,
    meta: { title: "ui.router.pageLogin", isNavigationMenu: false }
  },
  {
    path: "/user/password",
    component: () => import("@/views/sys/user-update-password.vue"),
    meta: { title: "ui.user.links.editPassword", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/bus/party-inter-bank-list",
    component: () => import("@/views/bus/party-inter-bank-list.vue"),
    meta: { title: "题目列表", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/point/addMetricsContent",
    component: () => import("@/views/point/addMetricsContent.vue"),
    meta: { title: "考核内容", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/point/pointList",
    component: () => import("@/views/point/pointList.vue"),
    meta: { title: "测评", requiresAuth: true, isNavigationMenu: false }
  },
  {
    path: "/clcLocationMark/clchousepersoninfo",
    component: () => import("@/views/clcLocationMark/clchousepersoninfo.vue"),
    meta: {title: "房屋居住人信息", requiresAuth: true, isNavigationMenu: false}
  },
  {
    path: "/iframe/:id?",
    component: Iframe,
    meta: { title: "iframe", isNavigationMenu: false }
  },
  {
    path: "/error",
    name: "error",
    component: Error,
    meta: { title: "ui.router.pageError", isNavigationMenu: false }
  }
];

export const errorRoute: Array<RouteRecordRaw> = [
  {
    path: "/:path(.*)*",
    redirect: { path: "/error", query: { to: 404 }, replace: true },
    meta: { isNavigationMenu: false }
  }
];

export default routes;
